import { getAreaObj } from '@/utils/util'
const tableConfig = {
	stripe: true,
	border: true,
	maxHeight: '80vh',
	columns: [
        {
            label: '姓名',
            prop: 'name',
            span: 8,
        },
        {
            label: '身份证号',
            prop: 'idCard',
            width:250,
            span: 8,
        },
        {
            label: '户籍地区',
            prop: 'cr_areas_name',
            width:400,
            span: 8,
        },
        {
            label: '户籍地址',
            prop: 'crAddress',
            width:250,
            span: 8,
        },
        {
            label: '入院时间',
            prop: 'checkinDate',
            span: 8,
        },
        {
            label: '出院时间',
            prop: 'checkoutDate',
            width:250,
            span: 8,
        },
        {
            label: '房间号',
            prop: 'roomNumber',
            span: 8,
        },
        {
            label: '老人护理类别',
            prop: 'careType',
            propName:'careTypeLabel',
            code:'NURSE_TYPE',
            api:'getDictItemList',
            type:'remoteSelect',
            span: 8,
        },
        {
            label: '能力等级（市标）',
            prop: 'abilityLevel',
            propName:'abilityLevelLabel',
            code:'ABILITY_LEVEL_CITY_STANDARD',
            api:'getDictItemList',
            type:'remoteSelect',
            span: 8,
        },
        {
            label: '入住协议',
            prop: 'checkAgreement',
            custome:'file',
            width:250,
            span: 24,
        },
        {
            label: '老人身份证',
            prop: 'idCardImg',
            custome:'file',
            width:250,
            span: 24,
        },
        {
            label: '户口簿',
            prop: 'residenceBooklet',
            custome:'file',
            width:250,
            span: 24,
        },
        {
            label: '老人照片',
            prop: 'oldmanImg',
            custome:'img',
            span: 24,
        },
        {
            label: '健康检查资料',
            prop: 'checkData',
            custome:'file',
            width:250,
            span: 24,
        },
        {
            label: '监护人姓名',
            prop: 'guardianName',
            span: 8,
        },
        {
            label: '监护人联系方式',
            prop: 'guardianPhone',
            width:200,
            span: 8,
        },
        {
            label: '监护人和老人关系',
            prop: 'relationRelation',
            propName:'relationRelationLabel',
            code:'ELDERLY_RELATIONSHIP',
            api:'getDictItemList',
            type:'remoteSelect',
            span: 8,
        },
    ]
}
export const baseConfig: any = {
	pageName: '等级提升补贴花名册',
	dictcodes: ['ORG_LEVEL','NURSE_TYPE','ABILITY_LEVEL_CITY_STANDARD','ELDERLY_RELATIONSHIP'],
	rowKey: 'id',
	tipLabel: 'name',
	// exportMqTopic: '/ning/export',
	api: {
		index: 'view_dpLevelPromotionSubsidyServiceObject_page',
	},
	auth: {
		index: 'view_dpLevelPromotionSubsidyServiceObject_page',
	},
	menuBtn: [
		{
			icon: 'editor',
			label: '查看详情',
			type: 'primary',
			operate: 'Detail',
			auth: '',
			text: true,
			show: true,
		},
	],
	dialogConfig: {
		width: '65%',
	},
	tableConfig,
	onLoadFormate: async (arr) => {
		console.log('参数二', arr)
		const tableData = arr.map((item) => {
			const areas_name = getAreaObj(item, 'belong')
			const cr_areas_name = getAreaObj(item,'cr')
			return {
				...item,
				areas_name,
				cr_areas_name
			}
		})
		return Promise.resolve(Object.freeze(tableData))
	},
}

